<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>求和</title>
   </head>
   <body>
      <script>
         const arr = [{
            name:'张三',
            salary: 1000
         },{
            name:'李四',
            salary: 2000
         },
            {
            name:'王五',
            salary: 3000
         },
         ]
         const salarys = arr.reduce((pre, cur) => {
            return pre + cur.salary
         },0)
         console.log(salarys)
      </script>
   </body>
</html>